package com.wsl.basiccontroller.controller;

import com.wsl.basicdao.pojo.User;
import com.wsl.basicserver.Service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class UserController {
    @Resource
    private  UserService userService;
   /* 查询所有用户*/
    @GetMapping("/list")
    public List<User> getAllUser(){
        List<User> userList = userService.getAllUser();
        for (User user : userList)
        {
            System.out.println(user);
        }
        return userList;
    }


}
